package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

public class Test1 {

	public static void main(String[] args) throws Exception {
		 OutputStream fout = new FileOutputStream("Kinva.txt");
		 int a = 50;
		 fout.write(97);
		 fout.write(98);
		 fout.write(Integer.toString(a).getBytes());
		 fout.write("中".getBytes());
		 fout.close();

		InputStream inputStream = new FileInputStream("Kinva.txt");
		inputStream.available();
//		int a = inputStream.read();
//		System.out.println(a);
//		int b = inputStream.read();
//		int c = inputStream.read();
//		System.out.println(b);
//		System.out.println(c);
		byte[] bs = new byte[100];
		inputStream.read(bs);
		for (int i = 0; i < bs.length; i++) {
			System.out.println(bs[i]);
		}
		String string = new String(bs,"utf-8");
		System.out.println(string);
		inputStream.close();
	}

}
